package com.meet.dao;

import com.meet.util.JDBCutil;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class WMDaoImpl implements WMDao{
    private PreparedStatement preparedStatement;
    private ResultSet resultSet;
    @Override
    public int Addamessage(int uId, int mId) throws SQLException {
        Connection conn = JDBCutil.getConnection();

        String sql = "insert into user_meeting (id,user_id,meeting_id,confirm) values (null,?,?,?)";
        preparedStatement = conn.prepareStatement(sql);
        preparedStatement.setObject(1,uId);
        preparedStatement.setObject(2,mId);
        preparedStatement.setObject(3,false);

        int count = preparedStatement.executeUpdate();

        JDBCutil.closeConnection();
        return count;
    }
}
